package com.baizhi.controller;

import com.baizhi.entity.Product;
import com.baizhi.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author yystart
 * @create 2019-10-04 16:48
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private ProductService service;

    @RequestMapping("/selectProductsByPage")
    public Map selectProductsByDeptIdAndPage(int page, int limit){
        return service.selectProductsByPage(page,limit);
    }

    @RequestMapping("/selectOne")
    public Product selectOne(int id){
        return service.selectOne(id);
    }

}
